package top.kaoshanji.p1ch03a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 代码清单-p1ch03a-62页a：表示线
 * author kaoshanji
 * ^_^
 * create time 2025/2/17 10:49
 */
public class Line {

    private static final Logger logger = LogManager.getLogger(Line.class);

    public static void main(String[] args) {

        logger.info("...代码清单-p1ch03a-62页a：表示线...");

        Point start = new Point(2, 3);
        Point end = new Point(3, 4);

        Line line = new Line(start, end);
        System.out.println(line.length());

    }

    private Point start;
    private Point end;

    public Line(Point start, Point end) {
        this.start = start;
        this.end = end;
    }

    public double length() {
        return start.distance(end);
    }

}
